package com.expressage.service.impl;

import com.expressage.dao.StaffDao;
import com.expressage.po.Staff;
import com.expressage.service.StaffService;
import com.expressage.vo.StaffVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("staffService")
public class StaffServiceImpl implements StaffService {

    @Autowired
    StaffDao staffDao;

    @Override
    public List<StaffVO> findAll() {
        return staffDao.findAll();
    }

    @Override
    public List<StaffVO> find(String staffname) {
        return staffDao.find(staffname);
    }

    @Override
    public StaffVO findByid(int id) {
        return staffDao.findByid(id);
    }

    @Override
    public List<StaffVO> findBySiteid(int siteid) {
        return staffDao.findBySiteid(siteid);
    }

    @Override
    public List<StaffVO> findByRid(int rid) {
        return staffDao.findByRid(rid);
    }

    @Override
    public List<StaffVO> findByCityid(int cityid) {
        return staffDao.findByCityid(cityid);
    }

    @Override
    public Staff findByNamePass(Staff staff) {
        return staffDao.findByNamePass(staff);
    }

    @Override
    public List<StaffVO> findByAreaid(int areaid) {
        return staffDao.findByAreaid(areaid);
    }

    @Override
    public List<StaffVO> findByStreetid(int streetid) {
        return staffDao.findByStreetid(streetid);
    }

    @Override
    public List<StaffVO> findBySalaryid(int salaryid) {
        return staffDao.findBySalaryid(salaryid);
    }

    @Override
    public boolean update(Staff staff) {
        return staffDao.update(staff)>0?true:false;
    }

    @Override
    public boolean add(Staff staff) {
        return staffDao.add(staff)>0?true:false;
    }

    @Override
    public boolean delete(int[] array) {
        return staffDao.delete(array)>0?true:false;
    }
}
